/*
 * @Author: wwssaabb
 * @Date: 2021-12-16 09:42:06
 * @LastEditTime: 2021-12-16 09:50:53
 * @FilePath: \handwritten-code\main\手机号3-4-4分割.js
 */


/* 
  将手机号分割成 183-7690-3383
*/

function splitMobile(mobile, format = '-') {
  return String(mobile).replace(/(?=(\d{4})+$)/g, format)
}

console.log(splitMobile(18376903383))